home *** CD-ROM | disk | FTP | other *** search
/ BMUG Revelations / BMUG Revelations.toast / Programming / Programming Utilities / LogoMation 1.0.1 / Examples / B & W / multi pen.lib / multi pen.lib
Encoding:
Text File  |  1992-09-15  |  1.1 KB  |  44 lines  |  [UVtx/UVtl]

  1. // this is a library file for Multi Pen
  2. /////////////////////////////////
  3. // Main routines:
  4. //    Header(str) - write a new header.  You have to call initHeader()
  5. //                         before calling Header.
  6.  
  7. Function initHeader(oldPen)
  8.     oldPen = penName()
  9.     Pen name="headerPen"
  10.     Pen fontname="Helvetica", fontsize=20, fontstyle="Bold"
  11.     header_old_str = ""
  12.     Pen name=oldPen
  13.  
  14. Function Header(str, oldPen)
  15.     oldPen = penName()
  16.     Pen name="headerPen"
  17.     If (header_old_str ≠ "")
  18.         Color 65535,65535,65535  // white
  19.         HeaderBG(header_old_str, 0)
  20.     Color 65535,65535,65535     // white
  21.     HeaderBG(str, 1)
  22.     header_old_str = str
  23.     Pen name=oldPen
  24.     
  25. Function HeaderBG(str, drawStr, width, height)
  26.     If (str = "")
  27.         Return
  28.     width = sWidth(str)
  29.     height = sAscent() + sDescent()
  30.     Up
  31.     Goto -width/2-3, height()/2-30-height-3, 0
  32.     Down
  33.     Fill 1
  34.         Repeat 2
  35.             Forward width + 6
  36.             Left 90
  37.             Forward height + 6
  38.             Left 90
  39.     If drawStr
  40.         Up
  41.         Goto -width/2, height()/2-30-height, 0
  42.         Color 65535,0,0
  43.         Print str
  44.         Pause 1.5